home *** CD-ROM | disk | FTP | other *** search
- /* ttytest.c (c) Copyright 1990 H.Rogers */
-
- /* This program tests the terminal I/O control routines. */
- /* For full information on termio, read the entry for the terminal
- * device driver in section 4 of the UNIX Programmer's Manual. */
-
- #include <stdio.h> /* standard I/O */
-
- #include "termio.h" /* terminal I/O */
- #include "unistd.h" /* UNIX system calls */
-
- int main()
- {
- struct termio t[1]; /* terminal I/O control structure */
-
- setvbuf(stdout,0,_IONBF,BUFSIZ); /* unbuffer stdout */
- ioctl(0,TCGETA,t); /* get terminal I/O control */
- t->c_lflag &= (~(ICANON|ECHO));
- t->c_cc[VMIN] = 1;
- t->c_cc[VTIME] = 0;
- ioctl(0,TCSETA,t); /* set terminal I/O control */
- while (-1) printf(" %02X ",getchar()); /* hex dump keyboard input */
- }
-